use axum::{body::Body, http::Response, response::IntoResponse};

use crate::router::resp::RespVO;

pub mod http;
// pub mod wechat_payment;
pub mod amap;

pub fn parse_date(date_str: &str, label: &str) -> Result<chrono::NaiveDateTime, Response<Body>> {
    match chrono::NaiveDateTime::parse_from_str(date_str, label) {
        Ok(d) => Ok(d),
        Err(e) => {
            Err(RespVO::<()>::error_without_data(format!("{}", e.to_string())).into_response())
        }
    }
}
